overlaylayout: Set the child type in the class
authorMatthias Clasen <mclasen@redhat.com>
Sat, 16 Jan 2021 03:35:11 +0000 (22:35 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 16 Jan 2021 03:35:11 +0000 (22:35 -0500)
We don't need to override create_layout_child here,
and setting the child type has the advantage that
the layout properties are showing up in the inspector.

gtk/gtkoverlaylayout.c

index 8795f96684a6118eb7b5fd0e20146abb1d13f91c..4642ea96756152d8b0390b84c8fd3a5f71867755 100644 (file)
@@ -432,25 +432,14 @@ gtk_overlay_layout_allocate (GtkLayoutManager *layout_manager,
     }
 }
 
-static GtkLayoutChild *
-gtk_overlay_layout_create_layout_child (GtkLayoutManager *manager,
-                                        GtkWidget        *widget,
-                                        GtkWidget        *for_child)
-{
-  return g_object_new (GTK_TYPE_OVERLAY_LAYOUT_CHILD,
-                       "layout-manager", manager,
-                       "child-widget", for_child,
-                       NULL);
-}
-
 static void
 gtk_overlay_layout_class_init (GtkOverlayLayoutClass *klass)
 {
   GtkLayoutManagerClass *layout_class = GTK_LAYOUT_MANAGER_CLASS (klass);
 
+  layout_class->layout_child_type = GTK_TYPE_OVERLAY_LAYOUT_CHILD;
   layout_class->measure = gtk_overlay_layout_measure;
   layout_class->allocate = gtk_overlay_layout_allocate;
-  layout_class->create_layout_child = gtk_overlay_layout_create_layout_child;
 }
 
 static void